package pl.edu.pw.stud.ltrzaska.policy.entity;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileType;
import org.apache.log4j.Logger;

import pl.edu.pw.stud.ltrzaska.logic.PolicyLoader;

public class File extends FilesystemObject {
	private static final Logger LOGGER = Logger.getLogger(PolicyLoader.class);
	
	private static final long serialVersionUID = -9195109629651669521L;
	String containsText;
	
	public List<FileObject> findVirtualFsEquivalents(FileObject parentVirtualFsObj) throws FileSystemException {
		List<FileObject> generalResult = super.findVirtualFsEquivalents(parentVirtualFsObj);
		List<FileObject> result = new ArrayList<FileObject>();
		if(generalResult != null) {
			for(FileObject fo : generalResult) {
				if(fo.getType() == FileType.FILE) {
					result.add(fo);
				}
			}
		}
		return result;
	}
}
